'''
Created on 2009-10-19

@author: dell
'''
from google.appengine.ext import db

class Tag(db.Model):
    '''
    classdocs
    '''
    name = db.StringProperty()
    
    def getTag(self,title):
        
        query = db.GqlQuery("select * from Tag where name=:1",title)
        tag = query.get()
        if tag:
            return tag
        else:
            tag = Tag(name = title)
            tag.put()
            return tag